package com.dxf.chepter05;

/**
 *  java中 子类可以指定调用父类的某个构造器 如:
 *      B调用A的有参构造
 *
 *
 */
public class T58_java超类分析 {
    public static void main(String[] args) {
       // B b = new B();
        B b2 = new B("tom");
    }
}


class A {

    public A(){
        System.out.println("A");
    }

    public A(String name){
        System.out.println("A(String name)"+name);
    }
}

class B extends A{
    public B(){
        //隐藏了 super()
        System.out.println("B");

    }

    public B (String name){
        //   B调用A的有参构造
        super(name);//调用A的有参数构造
        System.out.println("B(String name)"+name);
    }
}